package org.hetc;

import org.hetc.core.JmeterFileGenerater;
import org.hetc.model.HarJsonRootBean;
import org.hetc.utils.HarFileReader;

import java.io.IOException;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * @ClassName: Run
 * @Author: Jaxx
 * @Date: 2024/12/26
 * @Description:
 **/
public class Run {
    public static void main(String[] args) {
        try {
            HarJsonRootBean readFile = HarFileReader.readFile("/Users/jaxx/Downloads/多经招调方案-签订合同.har");
            JmeterFileGenerater jmeterFileGenerater = new JmeterFileGenerater();
            DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyyMMdd-HHmmss");
            jmeterFileGenerater.generateJmxFile(readFile.getLog(), "/Users/jaxx/Downloads/result-" + dateTimeFormatter.format(LocalDateTime.now()) + ".jmx");
        } catch (IOException e) {
            throw new RuntimeException(e);
        }

    }
}
